#ifndef __EEPROM_H
#define __EEPROM_H

#include "main.h"

#define IAP_EN          (1<<7)
#define IAP_SWBS        (1<<6)
#define IAP_SWRST       (1<<5)
#define IAP_CMD_FAIL    (1<<4)



void EEPROM_Init(void);

void IAP_IDLE(void);
uint8_t IAP_ReadOneByte(uint32_t address);
void IAP_WriteOneByte(uint32_t address, uint8_t dat);

void IAP_Erase(uint32_t address);
void IAP_ReadBytes(uint32_t address, uint8_t * DATA, uint8_t len);
void IAP_WriteBytes(uint32_t address, uint8_t * dat, uint8_t len);


#endif
